Enumeration of Words in Context-free Languages Using Haskell
نویسندگان
چکیده
Streszczenie. Jednym z rozważanych problemów kombinatorycznych jest wyliczenie w porządku leksykograficznym wszystkich słów o długości n należących do pewnego języka L. W niniejszym artykule zaprezentowano algorytm – wraz ze stosownym kodem w języku Haskell – służący do takiego wyliczania. Zakładamy, że język L zdefiniowany jest za pomocą gramatyki bezkontekstowej bez produkcji jednostkowych i bez λ-produkcji. Słowa kluczowe: język formalny bezkontekstowy, wyliczanie, Haskell, kolejność alfabetyczna
منابع مشابه
On Lexicographic Enumeration of Regular and Context-Free Languages
We show that it is possible to e ciently enumerate the words of a regular language in lexicographic order. The time needed for generating the next word is O(n) when enumerating words of length n. We also de ne a class of context-free languages for which e cient enumeration is possible.
متن کاملEnumeration of Context-Free Languages and Related Structures
In this paper, we consider the enumeration of context-free languages. In particular, for any reasonable descriptional complexity measure for context-free grammars, we demonstrate that the exact quantity of context-free languages of size is uncomputable. Nevertheless, we are able to give upper and lower bounds on the number of such languages. We also generalize our results to enumerate predicate...
متن کاملStudying impressive parameters on the performance of Persian probabilistic context free grammar parser
In linguistics, a tree bank is a parsed text corpus that annotates syntactic or semantic sentence structure. The exploitation of tree bank data has been important ever since the first large-scale tree bank, The Penn Treebank, was published. However, although originating in computational linguistics, the value of tree bank is becoming more widely appreciated in linguistics research as a whole. F...
متن کاملT F L T C E F L
We survey recent results on the enumeration of formal languages. In particular, we consider enumeration of regular languages accepted by deterministic and nondeterministic finite automata with n states, regular languages generated by regular expressions of a fixed length, and ω-regular languages accepted by Müller automata. We also survey the uncomputability of enumeration of context-free langu...
متن کاملHASDF: A Generalized LR-parser Generator for Haskell
Language-centered software engineering requires language technology that (i) handles the full class of context-free grammars, and (ii) accepts grammars that contain syntactic information only. The syntax definition formalism SDF combined with GLR-parser generation offers such technology. We propose to make SDF and GLR-parsing available for use with various programming languages. We have done so...
متن کامل